package cn.cdut.yiwenqian.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * CdutPostVidsrc entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CDUT_POST_VIDSRC", catalog = "cdutpostbar")
public class CdutPostVidsrc implements java.io.Serializable {

	// Fields

	private Integer unumber;
	private CdutPostAnswers cdutPostAnswers;
	private String address;

	// Constructors

	/** default constructor */
	public CdutPostVidsrc() {
	}

	/** minimal constructor */
	public CdutPostVidsrc(Integer unumber) {
		this.unumber = unumber;
	}

	/** full constructor */
	public CdutPostVidsrc(Integer unumber, CdutPostAnswers cdutPostAnswers,
			String address) {
		this.unumber = unumber;
		this.cdutPostAnswers = cdutPostAnswers;
		this.address = address;
	}

	// Property accessors
	@Id
	@GeneratedValue(generator="vidsrcIdGenerator")
	@GenericGenerator(name="vidsrcIdGenerator",strategy="increment")
	@Column(name = "unumber", unique = true, nullable = false)
	public Integer getUnumber() {
		return this.unumber;
	}

	public void setUnumber(Integer unumber) {
		this.unumber = unumber;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "answer")
	public CdutPostAnswers getCdutPostAnswers() {
		return this.cdutPostAnswers;
	}

	public void setCdutPostAnswers(CdutPostAnswers cdutPostAnswers) {
		this.cdutPostAnswers = cdutPostAnswers;
	}

	@Column(name = "address", length = 128)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

}